home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
gears.dir
/
00211_Script_Gear Parent
< prev
next >
Wrap
Text File
|
1997-05-26
|
3KB
|
96 lines
--o Gear parent
-- gGearMgrParent
property pStartCast, pEndCast, pNumOfIncrements, pSpriteNum, pDirection
property pCurrCast, pGearHorz, pGearVert, pSize, pAvailibleSlots
------------------------------------------------------------------------------------------------------------
on Birth me, WhatSize,CastLst, spritenum, Direction, StartCast, AjoiningEdge, Neighbor
set pStartCast = getat(CastLst,1)
set pEndCast = getat(CastLst,2)
set pNumOfIncrements = pEndCast - pStartCast
set pSpriteNum = spritenum
set pDirection = Direction
set pSize = WhatSize
set pGearHorz = the loch of sprite pSpriteNum
set pGearVert = the locv of sprite pSpriteNum
set pCurrCast = StartCast
set pAvailibleSlots = [1,1,1,1]
setat ( pAvailibleSlots, AjoiningEdge,Neighbor)
puppetsprite pSpriteNum, TRUE
set the castnum of sprite pSpriteNum = pCurrCast
return( me )
end Birth
------------------------------------------------------------------------------------------------------------
on mPerform me
set pCurrCast = pCurrCast + pDirection
if (pCurrCast > pEndCast) then set pCurrCast = pStartCast
else if (pCurrCast < pStartCast) then set pCurrCast = pEndCast
set the castnum of sprite pSpriteNum = pCurrCast
end mPerform
------------------------------------------------------------------------------------------------------------
on mInformNeighbors me
set whatpos = 1
repeat with Neighbor in pAvailibleSlots
if objectp( Neighbor ) then
set NeighborViewPos = (whatpos + 2) Mod 5
if NeighborViewPos = 0 then set NeighborViewPos = 1
mClearNeighbor (Neighbor, me)
end if
set whatpos = whatpos + 1
end repeat
end mInformNeighbors
------------------------------------------------------------------------------------------------------------
on mGetNeighborCords me
set Step = (pCurrCast - pStartCast) mod 3
set GearDescription = [pGearHorz,pGearVert,pSize, Step,pAvailibleSlots]
return( GearDescription )
end mSnapNeighbor
------------------------------------------------------------------------------------------------------------
on mGetRect me
return( the rect of sprite pSpriteNum )
end mGetRect
------------------------------------------------------------------------------------------------------------
on mGetDirection me
return( pDirection )
end mGetDirection
------------------------------------------------------------------------------------------------------------
on mSetNeighbor me, WhatSide, who
setat( pAvailibleSlots, WhatSide, who)
end mSetNeighbor
------------------------------------------------------------------------------------------------------------
on mClearNeighbor me, who
set whatpos = getpos( pAvailibleSlots, who)
setat (pAvailibleSlots,Whatpos,1)
end mClearNeighbor
------------------------------------------------------------------------------------------------------------
on mClearAllNeighbor me
set pAvailibleSlots = [1,1,1,1]
end mClearNeighbor
------------------------------------------------------------------------------------------------------------